<?php
/**
 * Created by IntelliJ IDEA.
 * User: HXL
 * Date: 2018/6/28
 * Time: 10:19
 */
namespace app\order\model;

use think\Db;
class Programs extends BaseModel{
    protected $tableName = 'ari_programs';


    public function search($where){
        $search = Db::table($this->tableName)->where($where)->select();
        return $search;
    }

    public function searchLike($search){
        $count = Db::table($this->tableName)->where('pro_id', 'like', "%$search%")
            ->whereOr('pro_name', 'like', "%$search%")
            ->count();
        $fittings = Db::table($this->tableName)->where('pro_id', 'like', "%$search%")
            ->whereOr('pro_name', 'like', "%$search%")
            ->paginate(10, $count, ['query' => request()->param()]);
        return $fittings;
    }

}